Twenty-three-year-old Cian Dennis, formerly identified as "Duke," and 24-year-old Khamil Brown are in custody, authorities said.
Officials said the incident happened Sunday afternoon on the 2100 block of West Oxford Street in North Philadelphia.
Officer Eric Rodriguez was waiting in traffic and honked his horn before Dennis came up and punched him in the face, according to PPD.
When Rodriguez got out of his car and identified himself as a policeman, authorities said Dennis pulled out a tan handgun and "held it down to his side."
During the struggle that followed, police said 24-year-old Yusef Coleman approached Rodriguez from behind and placed him in a headlock. Coleman was also armed and the officer "manag(ed) to push the weapon away," police said.
The magazine fell out and Rodriguez discharged the round in the chamber, PPD said. No one was struck.
Dennis then pointed his own gun at the off-duty officer, demanding that he drop the weapon, according to authorities.
"(Rodriguez) was subsequently beaten by multiple assailants and his personal weapon was stolen from its holster," PPD said.
The crowd dispersed when an on-duty officer arrived at the scene, and Coleman fled in a BMW, striking the off-duty's leg, according to police. He was arrested later on Sunday.
Dennis surrendered to police on Tuesday night and Brown was arrested on Wednesday morning, "due to her involvement in the incident."
Both are charged with criminal conspiracy, aggravated assault, robbery, and related charges, PPD said.
Rodriguez was treated for a black eye, facial bruises, and a leg injury. He is 42 years old and has been with the department for nine years, according to PPD.
He will be placed on administrative leave after he recovers from his injuries pending the outcome of the Internal Affairs and Officer-Involved Shooting Investigations.
Click here to follow Daily Voice West Chester and receive free news updates.